package com.example.main;

import com.example.entity.Car;
import com.example.entity.House;
import com.example.entity.Owner;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    @Test
    public void testCar() {
        String config = "bean.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        Car car = ac.getBean("car", Car.class);
        System.out.println(car);
    }

    @Test
    public void testHouse() {
        String config = "bean.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        House house = ac.getBean("house", House.class);
        System.out.println(house);
    }

    @Test
    public void testOwner() {
        String config = "bean.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        Owner owner = ac.getBean("owner", Owner.class);
        System.out.println(owner);
    }
}
